package Lesson14;

import java.util.Scanner;

public class Auction {
	int numberOfCars;
	int numberOfParticipants;

	


void start()
{
	Scanner s = new Scanner(System.in);
	System.out.println("Enter how many cars will be in the auction:");
	numberOfCars = s.nextInt();
	System.out.println("Enter how many participants will join in the auction:");
	numberOfParticipants = s.nextInt();
	Cars[] vehicles = new Cars[numberOfCars];
	Participants[] buyers = new Participants[numberOfParticipants];
	
	for(int i = 0; i<vehicles.length; i++)
	{
		vehicles[i] = new Cars();
		System.out.println("Enter a model for vehicle " + (i+1));
		vehicles[i].model = s.next();
		System.out.println("Enter a year of manufacture for vehicle " + (i+1));
		vehicles[i].year = s.next();
		System.out.println("Enter a power in HP for vehicle " + (i+1));
		vehicles[i].power = s.next();
	}
	for(int i = 0; i<buyers.length; i++)
	{
		buyers[i] = new Participants();
		System.out.println("Enter a name for buyer " + (i+1));
		buyers[i].name = s.next();
		System.out.println("Enter an age for buyer " + (i+1));
		buyers[i].age = s.nextInt();
	}
	for(int i = 0; i<buyers.length; i++)
	{
		String ownerName = buyers[i].name;
		for(int j = 0; j< vehicles.length; j++)
		{
	//		if(vehicles[i].owner != null) //is bought
			{
		//		if(vehicles[i].owner.name.equals(ownerName))
				{
					System.out.println("buyer " + ownerName + " bought " + vehicles[i].model );
				}
			}
		}
	}
	for(int i = 0; i<buyers.length; i++)
	{
		String ownerName = buyers[i].name;
		for(int j = 0; j< vehicles.length; j++)
		{
	//		if(vehicles[i].owner != null) //is bought
			{
	//			...
			}
		}
	}
	
}
}